ContentsIndexHome
PreviousUpNext
[] Operator

Returns the IElement on the specified dimension.

Returns the IElement reference on the specified dimension.

IElement& operator [](int dim);

 

Returns the IElement reference on the specified dimension.

const IElement& operator [](int dim) const;
// View is a kind of IDataView
ITuple* ptup = View->createTuple();

// You need a dereferenced ITuple to use the [] operator.
// Retrieve the IElement reference...
IElement& elem0 = (*ptup)[0];
elem0.setOrdinal(1);
// ...or use it immediately:
(*ptup)[0].setOrdinal(1);

// Or store the dereferenced ITuple...
ITuple& reftup = *ptup;
// ...to be used several times
reftup[0].setOrdinal(1);
reftup[1].setOrdinal(2);

ptup->close();